import java.util.Scanner;

public class 数字加密 {
    public static void main(String[] args) {
        int[] arr = new int[4];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i + 1) + "位数字");
            arr[i] = sc.nextInt();
        }
        System.out.println("加密后的数字是：" );
        int[] newArr = Encryption(arr);
        for (int i = 0; i < newArr.length; i++) {
            System.out.print(newArr[i]);
        }
    }
    public static int[] Encryption(int[] arr) {
        int[] newarr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            newarr[i] = (arr[3 - i] + 5) % 10;
        }
        return newarr;
    }
}
